/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package business;

import model.Customer;
import model.CustomerManager;

/**
 *
 * @author Administrator
 */
public class CreateNewCusCmd extends AbstractCommand {

    @Override
    public boolean execute(Object args) {
        if( CustomerManager.getInstance().getCustomerByID(getCustomer().getId()) != null )
            return false;
        
        CustomerManager.getInstance().addCustomer(getCustomer());
        return true;
    }
    
    private Customer customer;

    /**
     * @return the customer
     */
    public Customer getCustomer() {
        return customer;
    }

    /**
     * @param customer the customer to set
     */
    public void setCustomer(Customer customer) {
        this.customer = customer;
    }
    
}
